#(1)
# class Student():
#     def __init__(self,card,name,age,sex,height,weight,score,address,number):
#         self.card = card
#         self.name = name
#         self.age = age
#         self.sex = sex
#         self.height = height
#         self.weight = weight
#         self.score = score
#         self.address = address
#         self.number = number
#     def study(self, times):
#         print(f"学生{self.name}已经学习了{times}小时")
#
#     def game(self, game_name):
#         print(f"学生{self.name}在玩{game_name}")
#
#     def biancheng(self, hang):
#         print(f"{self.name}已经编写了{hang}行代码")
#
#     def shu_num(self, *args):
#         return sum(args)
#
# student1 = Student(
#     card="2023001",
#     name="张三",
#     age=20,
#     sex="男",
#     height=175,
#     weight=65,
#     score=90,
#     address="北京市海淀区",
#     number="13800138000")
# student1.study(3)
# student1.game("APEX")
# student1.biancheng(50)
# result = student1.shu_num(1,2,3,4,5)
# print(f"{student1.name}求得的和为{result}")

#(2)
# class Car():
#     def __init__(self, type, carriage, color, weight, fuel):
#         self.type = type
#         self.carriage = carriage
#         self.color = color
#         self.weight = weight
#         self.fuel = fuel
#
#     def run(self, function):
#         print(f"{self.color}的{self.type}正在{function}")
#
#     def __str__(self):
#         return (f"车辆信息:"
#                 f"车型号:{self.type}"
#                 f"车轮数:{self.carriage}"
#                 f"车身颜色:{self.color}"
#                 f"车重量:{self.weight}"
#                 f"油箱大小:{self.fuel}")
#
# fll = Car(
#     type="法拉利",
#     carriage=4,
#     color="白色",
#     weight=1800,
#     fuel=0  # 电动车无油箱
#     )
# ba = Car(
#     type='宝马x6',
#     carriage=4,
#     color='银色',
#     weight=2000,
#     fuel=90
# )
#
# lm = Car(
#     type='铃木',
#     carriage=4,
#     color='紫色',
#     weight=2000,
#     fuel=100
# )
#
# wl = Car(
#     type='五菱宏光',
#     carriage=4,
#     color='银色',
#     weight=2000,
#     fuel=110
# )
#
# tlj = Car(
#     type='拖拉机',
#     carriage=4,
#     color='黑色',
#     weight=2200,
#     fuel=90
# )
#
# tlj.run('越野')
# print(tlj.__str__())


#(3)
# class Laptop():
#     def __init__(self, model, times, color, weight, cpu_model, internal, hard):
#         self.model = model
#         self.times =times
#         self.color = color
#         self.weight = weight
#         self.cpu_model = cpu_model
#         self.internal = internal
#         self.hard = hard
#
#     def behavior(self,doing):
#         print(f"使用{self.model}正在{doing}")
#
# gaming_laptop = Laptop(
#     model="拯救者Y9000P",
#     times=6,
#     color="黑色",
#     weight=2.5,
#     cpu_model="Intel i9-13900HX",
#     internal=32,
#     hard=1024
#     )
#
# gaming_laptop.behavior('打游戏')



#(4)
# class Monkey():
#     def __init__(self, category, sex, color, weight):
#         self.catrgory = category
#         self.sex = sex
#         self.color = color
#         self.weight = weight
#
#     def make_fire(self, materials):
#         print(f'{self.color}的{self.catrgory}正在用{materials}造火')
#
#     def study(self, subject):
#         print(f'{self.color}的{self.catrgory}正在学习{subject}')
#
# monkey =Monkey(
#     category='金丝猴',
#     sex='雄性',
#     color='金色',
#     weight='20kg'
# )
# monkey.make_fire('木头')
# monkey.study('高数')


#打电话业务逻辑
# class Person():
#     def __init__(self, name, gender, age, charge, phone_brand, battery_capacity, screen, await_time, integral):
#         self.name = name
#         self.gender = gender
#         self.age = age
#         self.charge = charge
#         self.phone_brand = phone_brand
#         self.battery_capacity = battery_capacity
#         self.screen = screen
#         self.await_time = await_time
#         self.integral = integral
#
#     def send(self, content):
#         print(f'{self.name}正在使用{self.phone_brand}发送短信，内容为{content}')
#
#     def ring(self, phone_number, ring_time):
#         if not phone_number:
#             return "号码为空"
#         if self.charge < 1:
#             return '话费小于1元'
#
#         if ring_time <= 10:
#             cost = ring_time * 1
#             points = ring_time * 15
#         elif ring_time <= 20:
#             cost = ring_time * 0.8
#             points = ring_time * 39
#         else:
#             cost = ring_time * 0.65
#             points = ring_time * 48
#
#         self.charge -= cost
#         self.integral += points
#
#         return (f'成功拨打{phone_number}，时长{ring_time}分钟\n'
#                 f'扣费{cost}元，获得积分{points}\n'
#                 f'剩余话费{self.charge},积分{self.integral}')
#
# p = Person(
#     name='李四',
#     gender='男',
#     age=24,
#     charge=400,
#     phone_brand='oppo',
#     battery_capacity=20000,
#     screen=1800,
#     await_time=200,
#     integral=0
# )
# print(p.ring(18888,10))


